//#region 生成随机字符
export const random = () => Math.random().toString(36).substr(2)

export const randomString = len => {
  len = len || 32
  let t = '0123456789abcdefghijklmnopqrstuvwxyz', //ABCDEFGHIJKLMNOPQRSTUVWXYZ'
    l = t.length,
    r = ''
  for (let i = 0; i < len; i++) r += t.charAt(Math.floor(Math.random() * l))
  return r
}
//#endregion
